#/usr/bin/env python
# -*- coding: utf8 -*-
# title       :
# description :
# author      :'ShenMeng'

import maya.cmds as cmds
import pymel.core as pmel


class Validation(object):
    name = u'Locator | 定位器检查'
    dataDict = dict()

    def execute(self):
        self.dataDict = {}
        locatorList = pmel.ls(type='locator')
        if locatorList:
            for locator in locatorList:
                locatorParent = locator.getParent().longName()
                self.dataDict[locatorParent] = []
        return self.dataDict

    def correct(self):
        for locator, _ in self.dataDict.items():
            cmds.delete(locator)

    def search(self, obj):
        cmds.select(obj)

